﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CSharp.Libs.Koc;
using CSharp.Libs.Koc.UserControls;


namespace KocReporter
{
    /// <summary>
    /// Interaktionslogik für MainWindow.xaml
    /// </summary>
    public partial class Main : Window
    {
        #region declarations
        private Kernel _KRNL = null;
        private KocReportGetterViewModel _KRGVM = null;
        #endregion 



        #region constructor / destructor
        public Main()
        {
            InitializeComponent();

            _KRNL = new Kernel();

            _KRNL.LoggingEnabled = true;
            _KRNL.LogTrafficMonitor = true;
            _KRNL.LogPostHandler = true;

            kocKernel2Control1.Initialize(_KRNL);
            kocReportGetter1.Initialize(_KRNL, kocKernel2Control1.ViewModel);
            
            _KRGVM = kocReportGetter1.DataContext as KocReportGetterViewModel;
            if (_KRGVM != null)
            {
                _KRGVM.LoggingEnabled = true;
            }

            messageLoggingTextBox1.InitViewModel(_KRNL.ML);

            //make Logging switchable
            mnuLoggingEnabled.DataContext = _KRNL;
            mnuLogTrafficMonitor.DataContext = _KRNL;
            mnuLogPostHandler.DataContext = _KRNL;
            if (_KRGVM != null)
            {
                mnuLogReportWatcher.DataContext = _KRGVM;
            }
        }
        #endregion



        #region event handling
        #endregion



        #region private functions
        #endregion

    }
}
